from django.db import models
from apps.common.base.models import BaseModel
from apps.system.lessee.models import Lessee
from apps.account.models import Account

class Student(BaseModel):

    gender = (
        ("M", "男"),
        ("W", "女"),
    )
    types = (
        ("1", "在校生"),
        ("2", "社会人员"),
    )

    lessee = models.ForeignKey(Lessee, related_name="lessee_student", verbose_name='租户', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    account = models.ForeignKey(Account, related_name="account_student", verbose_name='账号', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)
    
    types = models.CharField("类别", max_length=200, choices=types, blank=True, default='')
    school_name = models.CharField("学校", max_length=200, blank=True, null=True, default='')
    dept_name = models.CharField("系部", max_length=200, blank=True, null=True, default='')
    class_name = models.CharField("班级", max_length=200, blank=True, null=True, default='')
    realname = models.CharField("姓名", max_length=200, blank=True, null=True, default='')
    gender = models.CharField("性别", max_length=200, choices=gender, blank=True, default='')
    stu_id = models.CharField("学号", max_length=200, blank=True, null=True, default='')
    id_card = models.CharField("身份证号", max_length=200, blank=True, null=True, default='')
    phone = models.CharField("电话", max_length=200, blank=True, null=True, default='')
    avatarUrl = models.CharField("头像", max_length=200, blank=True, null=True, default='')

    class Meta:
        verbose_name = 'Student'
        verbose_name_plural = verbose_name
